// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   WebColumn.java

package include.ecommerce;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class WebColumn
{

	private nseer_db db;
	private String cols[];
	private String cols_ID[];

	public WebColumn(String dbname, String unit)
	{
		cols = new String[0];
		cols_ID = new String[0];
		try
		{
			db = new nseer_db(dbname);
			String sql = (new StringBuilder("select count(*) from ecommerce_colsa where unit_id='")).append(unit).append("'").toString();
			ResultSet rs = db.executeQuery(sql);
			int i = 0;
			if (rs.next())
			{
				cols = new String[rs.getInt("count(*)")];
				cols_ID = new String[rs.getInt("count(*)")];
				sql = (new StringBuilder("select * from ecommerce_colsa where unit_id='")).append(unit).append("'").toString();
				for (rs = db.executeQuery(sql); rs.next();)
				{
					cols[i] = rs.getString("first_kind_name");
					cols_ID[i] = rs.getString("first_kind_ID");
					i++;
				}

			}
			db.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}

	public String[] getCols()
	{
		return cols;
	}

	public String[] getCols_ID()
	{
		return cols_ID;
	}

	public void close()
	{
		db.close();
	}
}
